export default {
  namespaced: true,
  state: {
    //  ===== 合同管理 ======
    managementAuth: [], // 合同管理
    fileAuth: [], // 合同归档管理
    moduleAuth: [], // // 合同模板
    reviewAuth: [], // 合同评审
  },
  mutations: {
    setAuthList(state, data) {
      data.forEach((element) => {
        element.children.forEach((item) => {
          switch (item.path) {
            case '/contractManagement/review':
              state.reviewAuth = item.children;
              break;
            case '/contractManagement/management':
              state.managementAuth = item.children;
              break;
            case '/contractManagement/file':
              state.fileAuth = item.children;
              break;
            case '/contractManagement/module':
              state.moduleAuth = item.children;
              break;
            default:
              break;
          }
        });
      });
    },
  },
};
